<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>编辑用户</title>
</head>
<body>
	<div class="content-wrapper" th:fragment="updateUser">
		<h3>编辑用户</h3>
		<div class="row "></div>
		<div class="panel panel-default">
			<div class="panel-heading"></div>
			<div class="panel-body">
				<form method="post" id="updateUser-from">
					<fieldset>
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">*用户名</label>
							<div class="col-sm-7">
								<input id="userId" name="userId" th:value="${userId}"
									type="hidden" /> <input type="hidden" id="opr" name="opr"
									th:value="${opr}" /> <input id="loginName" disabled="true"
									class="form-control" name="loginName" />
							</div>
						</div>
					</fieldset>
					<fieldset>
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">*昵称</label>
							<div class="col-sm-7">
								<input id="displayName" class="form-control" name="displayName"
									required="" minlength="1"/>
							</div>
						</div>
					</fieldset>

					<fieldset id="defaultPassword" th:if="${opr eq 'edit'}">
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">密码</label>
							<div class="col-sm-4">
								<button type="button" class="btn btn-default" id="rePassword">重置密码</button>
							</div>
						</div>
					</fieldset>
					<fieldset id="newPassword" th:if="${opr eq 'repassword'}">
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">*新密码</label>
							<div class="col-sm-7">
								<input id="password" class="form-control" type="password"
									name="password" required="" minlength="1"></input>
							</div>
						</div>
					</fieldset>
					<fieldset id="passwordAgain" th:if="${opr eq 'repassword'}">
						<div class="form-group">
							<label class="col-sm-2 control-label">*确认新密码</label>
							<div class="col-sm-7">
								<input id="againPassword" class="form-control" type="password"
									name="userPassword" required="" minlength="1"></input>
							</div>
							<span id="errorMsg" style="color: red;"></span>
						</div>
					</fieldset>
					<fieldset>
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">*电子邮箱</label>
							<div class="col-sm-7">
								<input id="email" class="form-control" type="email" name="email"
									required="" minlength="1"></input>
							</div>
						</div>
					</fieldset>
					<fieldset>
						<div class="form-group">
							<label for="input-id-1" class="col-sm-2 control-label">*手机号码</label>
							<div class="col-sm-7">
								<input id="mobile" class="form-control" type="text"
									name="mobile" required="" minlength="11" maxlength="11"
									digits="true" />
							</div>
						</div>
					</fieldset>
				</form>

				<fieldset id="power" th:if="${opr eq 'edit'}">
					<div class="form-group">
						<label class="col-sm-2 control-label">用户角色</label>
						<div class="col-sm-10">
							<div class="row">
								<div class="col-lg-8">
									<!-- START panel tab-->
									<div role="tabpanel" class="panel panel-transparent">
										<!-- Nav tabs-->
										<ul role="tablist" class="nav nav-tabs nav-justified">
											<li role="presentation" class="active"><a href="#role"
												aria-controls="home" role="tab" data-toggle="tab"
												class="bb0" aria-expanded="true"> <em class=""></em>角色
											</a></li>
										</ul>
										<!-- 添加角色和账户权限-->
										<div class="tab-content p0 bg-white">
											<div id="role" role="tabpanel" class="tab-pane active">
												<table class="table" id="userHasRole">

												</table>
												<div class="panel-footer text-right">
													<button type="button" data-toggle="modal"
														data-target="#myModal" class="btn btn-default btn-sm">添加角色</button>
												</div>
											</div>
										</div>
									</div>
									<!-- END panel tab-->
								</div>

							</div>
						</div>
					</div>
				</fieldset>
				<fieldset>
					<div class="form-group">
						<label for="input-id-1" class="col-sm-2 control-label"></label>
						<div class="col-sm-7">
							<button type="button" class="btn btn-primary pull-right"
								id="submitBtn">保&nbsp;&nbsp;存</button>
							<button type="button" class="btn btn-default pull-right mr-sm"
								id="userListPage">返回</button>
						</div>
					</div>
				</fieldset>

			</div>
		</div>
	</div>


	<div th:fragment="updateUser_dialog">
		<!-- Modal-role-->
		<div id="myModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="false" class="modal fade"
			style="padding-top: 50px;">
			<div class="modal-dialog" style="width: 310px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" data-dismiss="modal" aria-label="Close"
							class="close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 id="myModalLabel" class="modal-title">添加角色</h4>
					</div>
					<div class="modal-body">
						<form id="roleForm">
							<div class="panel panel-default">
								<!-- START list group-->
								<div data-height="300" data-scrollable="" class="list-group" >
									<div class="media-box-body clearfix"
										style="text-align: center; font-weight: bold; padding: 10px;background-color: #fafafa;">
										<div class="checkbox c-checkbox col-md-4">
											<label><input type="checkbox" id="checkRoleAll"
												name="choiceRoleAll" value="" /> <span
												class="fa fa-check"></span></label>
										</div>
										<div class="col-md-5 " style="padding-top: 10px;">
											<div>角色列表</div>
										</div>
									</div>
									<div class="row media-box-body clearfix"
										style="text-align: center; line-height: 25px;">
										<ul id="roleData">

										</ul>

									</div>
								</div>
							</div>
							<input type="hidden" id="roleIdList" name="roleIdList" value="" />
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
						<button type="button" class="btn btn-primary" id="submitRole">保存</button>
					</div>
				</div>
			</div>
		</div>


	</div>

	<div th:fragment="updateUser_js">
		<script th:src="@{/business/manager/user/updateUser.js}"></script>
	</div>

</body>
</html>